def win(Map, word):
    for i in range(20):
        for j in range(20):
            if i + 4 < 20 and all(Map[i + k][j] == word for k in range(5)):
                return True
            if j + 4 < 20 and all(Map[i][j + k] == word for k in range(5)):
                return True
            if i + 4 < 20 and j + 4 < 20 and all(Map[i + k][j + k] == word for k in range(5)):
                return True
            if i - 4 >= 0 and j + 4 < 20 and all(Map[i - k][j + k] == word for k in range(5)):
                return True
    return False

Map = [list(input()) for _ in range(20)]
x_cnt = sum(row.count('x') for row in Map)
o_cnt = sum(row.count('o') for row in Map)

if abs(x_cnt - o_cnt) > 1 or win(Map, 'x') or win(Map, 'o'):
    print('No')
else:
    print('Yes')